def merge_data(data):
    merged_data = []
    current_element = None
    current_time = 0.0

    for group in data:
        for element, time in group:
            if element == current_element:
                current_time += time
            else:
                if current_element is not None:
                    merged_data.append((current_element, current_time))
                current_element = element
                current_time = time
    # 添加最后一个元素
    if current_element is not None:
        merged_data.append((current_element, current_time))

    return merged_data
'''
# 示例数据
data = [[('O', 100.0)], [('O', 0.5970039595496814), ('F', 99.40299604045032)], [('F', 1), ('O', 10)],[('F', 1), ('O', 10)]]

# 调用函数
result = merge_data(data)
print(result)
'''